Lightweight tracing SDK for AI agents. Capture decisions, tool calls, and LLM events with one context manager.
Project description
Agent Debugger
See why your AI agent did that. This package gives you a tracing SDK for custom agents plus integration points for PydanticAI and LangChain.
What This Package Gives You
TraceContextfor explicit tracing- decorators for agent, tool, and LLM boundaries
- adapter entry points for supported frameworks
- configuration for local or cloud-oriented transport settings
Quick Start
pip install peaky-peek
import asyncio
from agent_debugger_sdk import TraceContext, init
init() # Local mode by default
async def main() -> None:
async with TraceContext(agent_name="demo_agent", framework="custom") as ctx:
await ctx.record_decision(
reasoning="Need external information",
confidence=0.9,
chosen_action="call_search_tool",
evidence=[{"source": "user_input", "content": "What is the weather?"}],
)
asyncio.run(main())
Run the backend locally if you want to receive and inspect events:
pip install peaky-peek-server
uvicorn api.main:app --reload --port 8000
Configuration
from agent_debugger_sdk import init
init(
api_key="ad_live_...", # optional
endpoint="https://api.agentdebugger.dev",
enabled=True,
sample_rate=1.0,
redact_prompts=False,
)
If no API key is set, the SDK stays in local mode and defaults to http://localhost:8000.
Integration Options
TraceContext
Use TraceContext when you want explicit control over recorded events.
import asyncio
from agent_debugger_sdk import TraceContext, init
init()
async def main() -> None:
async with TraceContext(agent_name="my_agent", framework="custom") as ctx:
await ctx.record_tool_call("weather_api", {"location": "SF"})
result = {"forecast": "sunny"}
await ctx.record_tool_result("weather_api", result=result, duration_ms=150)
asyncio.run(main())
Decorators
Use decorators when your code already has clear boundaries:
from agent_debugger_sdk import init, trace_agent, trace_tool
init()
@trace_tool(name="search_docs")
async def search_docs(query: str) -> list[str]:
return [query]
@trace_agent(name="docs_agent", framework="custom")
async def docs_agent(query: str) -> list[str]:
return await search_docs(query)
Adapters
PydanticAI
from pydantic_ai import Agent
from agent_debugger_sdk import init
from agent_debugger_sdk.adapters import PydanticAIAdapter
init()
agent = Agent("openai:gpt-4o")
adapter = PydanticAIAdapter(agent, agent_name="support_agent")
LangChain
from agent_debugger_sdk import TraceContext, init
from agent_debugger_sdk.adapters import LangChainTracingHandler
init()
context = TraceContext(session_id="demo", agent_name="langchain_agent", framework="langchain")
handler = LangChainTracingHandler(session_id="demo")
handler.set_context(context)
Important:
- the current LangChain path is handler-based
init()does not currently auto-patch LangChain for zero-code instrumentation
Environment Variables
| Variable | Default | Description |
|---|---|---|
AGENT_DEBUGGER_API_KEY |
- | API key for cloud-oriented mode |
AGENT_DEBUGGER_URL |
http://localhost:8000 |
Collector endpoint |
AGENT_DEBUGGER_ENABLED |
true |
Enable or disable tracing |
AGENT_DEBUGGER_SAMPLE_RATE |
1.0 |
Sampling rate |
AGENT_DEBUGGER_REDACT_PROMPTS |
false |
Redact prompts before storage |
AGENT_DEBUGGER_MAX_PAYLOAD_KB |
100 |
Max payload size for emitted events |
More Docs
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file peaky_peek-0.1.15.tar.gz.
File metadata
- Download URL: peaky_peek-0.1.15.tar.gz
- Upload date:
- Size: 36.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d7d6d6c6194185f664463108b1134c1faca49b0491ba07ad1e2ebdea47e642b
|
|
| MD5 |
fe9cfdf462251e5b79f7f7fe5e92dc6f
|
|
| BLAKE2b-256 |
37e94835a8b61af957c1c6c288757f32d9cf008e237b800e36bba2265bff7c36
|
Provenance
The following attestation bundles were made for peaky_peek-0.1.15.tar.gz:
Publisher:
publish.yml on acailic/agent_debugger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
peaky_peek-0.1.15.tar.gz -
Subject digest:
7d7d6d6c6194185f664463108b1134c1faca49b0491ba07ad1e2ebdea47e642b - Sigstore transparency entry: 1218477926
- Sigstore integration time:
-
Permalink:
acailic/agent_debugger@9ddd2c61292429a08ef65ed03d7aae7d585e8527 -
Branch / Tag:
refs/tags/v0.1.15 - Owner: https://github.com/acailic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9ddd2c61292429a08ef65ed03d7aae7d585e8527 -
Trigger Event:
push
-
Statement type:
File details
Details for the file peaky_peek-0.1.15-py3-none-any.whl.
File metadata
- Download URL: peaky_peek-0.1.15-py3-none-any.whl
- Upload date:
- Size: 111.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b94386f25d94c520dc594acb67adcf174093aa0cd1add2ea1b496c60846ed7b
|
|
| MD5 |
3eccd7e13b888fde00ca7c7e88afbcc3
|
|
| BLAKE2b-256 |
4d53a815204a9b4b1640969140aed63890495962c4ecac3ab7f81e3f71e57707
|
Provenance
The following attestation bundles were made for peaky_peek-0.1.15-py3-none-any.whl:
Publisher:
publish.yml on acailic/agent_debugger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
peaky_peek-0.1.15-py3-none-any.whl -
Subject digest:
6b94386f25d94c520dc594acb67adcf174093aa0cd1add2ea1b496c60846ed7b - Sigstore transparency entry: 1218478007
- Sigstore integration time:
-
Permalink:
acailic/agent_debugger@9ddd2c61292429a08ef65ed03d7aae7d585e8527 -
Branch / Tag:
refs/tags/v0.1.15 - Owner: https://github.com/acailic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9ddd2c61292429a08ef65ed03d7aae7d585e8527 -
Trigger Event:
push
-
Statement type: